package com.HomeWork12.work2;

public class test {
    public static void main(String[] args) {
        Player player = new Player("张飒",2000,300,3000);
        Dragon d=new Dragon("龙",2000,2000,1000,50);
        while (true) {
            player.attack(d);
            if (d.getBlood()<=0){System.out.println(d.getName()+"被打死了，游戏结束");
                System.out.println(player.getProfession()+"剩余的血量为:"+player.getPlayerBlood());
                break;
            }
            d.attack(player);
            if (player.getPlayerBlood()<=0){
                System.out.println(player.getProfession()+"被打死了，游戏结束");
                System.out.println(d.getName()+"剩余的血量为:"+d.getBlood());
                break;
            }
        }
        Dogface dogface = new Dogface("小兵",2000,200,20,50);

        while (true) {
            player.attack(dogface);
            if (dogface.getBlood()<=0){System.out.println(dogface.getName()+"被打死了，游戏结束");
                System.out.println(player.getProfession()+"剩余的血量为:"+player.getPlayerBlood());
                break;
            }
            dogface.attack(player);
            if (player.getPlayerBlood()<=0){
                System.out.println(player.getProfession()+"被打死了，游戏结束");
                System.out.println(d.getName()+"剩余的血量为:"+d.getBlood());
                break;
            }
        }

    }
}
